pp108 : Generating Log Messages from Repository

Generating Log Messages from Repository

This topic describes the procedure to generate log messages from the repository.
The Process Platform framework provides a tool calledcom.eibus.tools.internal.MessageGeneratorthat generates message bundles from the <Message Repository>.xml file.
  1. Provide the input parameters and run the tool.
    1. For the com.eibus.tools.internal.MessageGenerator tool, specify the alert repository file name and the fully qualified name of the class to be generated (this includes the package to which the class belongs).
    2. Set the Classpath, Path and Process_Platform_install_dir in the following format:

      Operating System

      Path

      Windows


      * Set Process_Platform_install_dir = <Process_Platform_Installation_Directory>
      * Set CLASSPATH = %CLASSPATH% ; <Process_Platform_Installation_Directory> / Cordys.jar
      * Set PATH = % PATH% ; <Process_Platform_Installation_Directory> / Lib

      Linux


      * Export Process_Platform_install_dir = <Process_Platform_Installation_Directory>
      * Export CLASSPATH = $CLASSPATH : <Process_Platform_Installation_Directory> / Cordys.jar
      * Export PATH = $ PATH : <Process_Platform_Installation_Directory> / Lib

    3. Run the Message Generator tool to generate the . java file. This file is generated in the directory, from where you run the tool. If you mention only the class name as an input parameter, the package will not be defined.
      A sample code to generate the Java file is given below:
       java com.eibus.tools.internal.MessageGenerator <Messagedefinitions.xml> <Fully qualified classname> Example: java com.eibus.tools.internal.MessageGenerator Cordys.ESBServer.LogMessages.xml com.eibus.localization.message.internal.LogMessages 
      Here, Cordys.ESBServer.LogMessages.xml is the LogMessage repository file name while com.eibus.localization.message.internal.LogMessages is the name of the class to be generated. The LogMessages.java file containing the source is generated.
  2. Run the LogMessages.java from the command prompt.
    Here's an example:
     javac -d . LogMessages.java 
    The logMessages class file is generated.
  3. Modify the classpath to include the class file.
  4. Copy the <message repository>. xml file to <Process_Platform_Installation_Directory>\<localization folder>.

Related tasks

Generating Alerts
Publishing Alerts

Related reference

Message Repository
Defining Process Platform Alerts